/*
 *  Copyright 2023 Collate.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *  http://www.apache.org/licenses/LICENSE-2.0
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

@import (reference) '../../../styles/variables.less';

.user-team-select-dropdown {
  .ant-tabs {
    .ant-tabs-tab {
      padding: 8px 16px;

      &.ant-tabs-tab-active {
        .ant-tabs-tab-btn {
          color: @primary-color;
        }
      }
    }

    .ant-tabs-content {
      padding: 0;
    }

    .ant-tabs-tabpane {
      padding: 0;
    }
  }

  .search-container {
    padding: 8px 12px;
    border-bottom: 1px solid @border-color;

    .ant-input-search {
      .ant-input {
        border-radius: 6px;
      }
    }
  }

  .options-container {
    padding: 4px 0;

    .ant-select-item {
      padding: 8px 12px;

      &.selected-option {
        color: @primary-color;
      }

      .anticon {
        margin-right: 8px;
      }
    }
  }

  .loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
  }

  .load-more-container {
    padding: 8px 12px;
    text-align: center;
    border-top: 1px solid @border-color;

    .ant-typography {
      margin: 0;
    }
  }
}

.selected-values-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  min-height: 24px;

  .user-tag {
    margin: 0;
  }
}

// Override Select component styles for custom rendering
.ant-select-multiple {
  &.user-team-select {
    .ant-select-selector {
      padding: 4px 8px;

      .ant-select-selection-search {
        display: none; // Hide default search since we have custom search
      }

      .ant-select-selection-placeholder {
        display: flex;
        align-items: center;
        height: 100%;
      }
    }

    &.ant-select-open {
      .ant-select-selector {
        border-color: @primary-color;
      }
    }
  }
}

// User tag customization within select
.user-team-select {
  .user-tag {
    .user-tag-content {
      max-width: 120px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }
}
